package com.yj.timecapsule.mapper;

import com.github.pagehelper.Page;
import com.yj.timecapsule.entity.diaries.Diaries;
import com.yj.timecapsule.entity.diaries.DiariesWithBLOBs;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface DiariesMapper {
    int deleteByPrimaryKey(Long id);

    int insert(DiariesWithBLOBs record);

    int insertSelective(DiariesWithBLOBs record);

    DiariesWithBLOBs selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(DiariesWithBLOBs record);

    int updateByPrimaryKeyWithBLOBs(DiariesWithBLOBs record);

    int updateByPrimaryKey(Diaries record);

    Page<DiariesWithBLOBs> selectPageByKeyWordAndUserId(@Param("keyWord") String keyWord,@Param("userId") Long userId);

    List<DiariesWithBLOBs> selectByIds(@Param("ids") List<Long> diariesIdList);

    List<Diaries> selectByUserId(Long userId);

    Page<DiariesWithBLOBs> selectPageByKeyWordAndUserIds(@Param("keyWord") String keyWord, @Param("ids") List<Long> userIds);
}